package com.jecy.springcloud.web;

import com.jecy.springcloud.domain.UserService;
import com.jecy.springcloud.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by huijun on 17/6/30.
 */
@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/user",method = RequestMethod.GET)
    public List<User> readUserInfo() {
        List<User> users = userService.searchAll();
        return users;
    }
}
